package view;

import java.awt.Font;
import java.awt.SystemColor;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

/**
 * @uthor BWH
 */

public class GUI_Login extends JPanel {
	TeraFootMain teraFootMain;
	private final JTextField textUser;
	JButton btnLogInd;
	JLabel lblStatus;
	private final JPasswordField passwordField;

	public GUI_Login(TeraFootMain teraFootMain) {
		setBackground(SystemColor.activeCaption);
		this.teraFootMain = teraFootMain;
		setLayout(null);

		textUser = new JTextField();
		textUser.setActionCommand("Log ind");
		textUser.addActionListener(teraFootMain.getAcListener());
		textUser.setBounds(217, 114, 89, 20);
		add(textUser);

		final JLabel lblBrugernavn = new JLabel("Brugernavn:");
		lblBrugernavn.setBounds(115, 117, 86, 14);
		add(lblBrugernavn);

		final JLabel lblPassword = new JLabel("Password:");
		lblPassword.setBounds(115, 148, 69, 14);
		add(lblPassword);

		final JLabel lblTerafoot = new JLabel("TeraFoot!");
		lblTerafoot.setHorizontalAlignment(SwingConstants.CENTER);
		lblTerafoot.setFont(new Font("Tahoma", Font.BOLD, 37));
		lblTerafoot.setBounds(113, 11, 190, 49);
		add(lblTerafoot);

		final JLabel lblBookingJournalOg = new JLabel(
				"Booking-, journal- og patientsh\u00E5ndteringssystem");
		lblBookingJournalOg.setHorizontalAlignment(SwingConstants.CENTER);
		lblBookingJournalOg.setFont(new Font("Tahoma", Font.ITALIC, 12));
		lblBookingJournalOg.setBounds(80, 71, 284, 14);
		add(lblBookingJournalOg);

		btnLogInd = new JButton("Log ind");
		btnLogInd.setActionCommand("Log ind");
		btnLogInd.addActionListener(teraFootMain.getAcListener());
		btnLogInd.setBounds(217, 176, 89, 23);
		add(btnLogInd);

		lblStatus = new JLabel("");
		lblStatus.setBackground(SystemColor.activeCaption);
		lblStatus.setOpaque(true);
		lblStatus.setBounds(217, 210, 338, 20);
		add(lblStatus);

		passwordField = new JPasswordField();
		passwordField.setEchoChar('*');
		passwordField.setActionCommand("Log ind");
		passwordField.addActionListener(teraFootMain.getAcListener());
		passwordField.setBounds(217, 145, 89, 20);
		add(passwordField);
	}

	public JTextField getTextUser() {
		return textUser;
	}

	public JButton getBtnLogInd() {
		return btnLogInd;
	}

	public JLabel getLblStatus() {
		return lblStatus;
	}

	public JPasswordField getPasswordField() {
		return passwordField;
	}
}
